;;; init-flycheck.el --- Flycheck configuration -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(with-eval-after-load 'flycheck
  (add-hook 'flycheck-mode-hook #'flycheck-pycheckers-setup)
  (add-hook 'flycheck-mode-hook #'flycheck-popup-tip-mode)

  (define-fringe-bitmap 'my-flycheck-fringe-indicator
    (vector #b00000000
            #b00000000
            #b00000000
            #b00000000
            #b00000000
            #b00000000
            #b00000000
            #b00011100
            #b00111110
            #b00111110
            #b00111110
            #b00011100
            #b00000000
            #b00000000
            #b00000000
            #b00000000
            #b00000000))

  (flycheck-define-error-level 'error
    :severity 2
    :overlay-category 'flycheck-error-overlay
    :fringe-bitmap 'my-flycheck-fringe-indicator
    :fringe-face 'flycheck-fringe-error)

  (flycheck-define-error-level 'warning
    :severity 1
    :overlay-category 'flycheck-warning-overlay
    :fringe-bitmap 'my-flycheck-fringe-indicator
    :fringe-face 'flycheck-fringe-warning)

  (flycheck-define-error-level 'info
    :severity 0
    :overlay-category 'flycheck-info-overlay
    :fringe-bitmap 'my-flycheck-fringe-indicator
    :fringe-face 'flycheck-fringe-info))

(with-eval-after-load 'flycheck-pycheckers
  (setq flycheck-pycheckers-checkers '(flake8 pylint))
  (setq flycheck-python-pylint-executable "pylint")
  (setq flycheck-python-flake8-executable "flake8")
  (setq flycheck-pycheckers-max-line-length 79))

(with-eval-after-load 'flycheck-popup-tip
  (setq flycheck-popup-tip-error-prefix ""))


(provide 'init-flycheck)
;;; init-flycheck.el ends here
